home *** CD-ROM | disk | FTP | other *** search
- /*
- * memorg.c
- * Jerzy Tomasik, 12-Jul-1991
- * Data memory organization in a typical
- * C program
- */
-
- #include <stdlib.h>
- #include <stdio.h>
-
- static char str1[] = "This is initialized, static";
- static char str2[2048];
- char str3[4096];
-
- int main(void)
- {
- char auto_str[512];
- char *heap_str;
- int dummy;
-
- heap_str = malloc(512);
-
- printf("str1 %Fp\n", str1);
- printf("str2 %Fp\n", str2);
- printf("str3 %Fp\n", str3);
- printf("auto_str %Fp\n", auto_str);
- printf("heap_str %Fp\n", heap_str);
-
- free(heap_str);
- return(0);
- }
-